<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_VERSION_VAL}" />
<style>
	.control-group .controls label{
		display:inline-block;
	}
	ul,li{list-style: none;}
	.upload_img_list{width: 100%;display: block;}
	.upload_img_list li{float: left;margin-right: 5px;margin-bottom:10px;}
	.upload_img_list li img{width:80px;height: 80px;border:1px solid #cccccc;padding:1px;}

	.tab_on_select{background: #5bb75b;}
	.tab_on_select a{color:#ffffff;}

	.upload_img_list_350_476{width: 100%;display: block;}
	.upload_img_list_350_476 li{float: left;margin-right: 5px;margin-bottom:10px;}
	.upload_img_list_350_476 li img{width:350px;height: 476px;border:1px solid #cccccc;padding:1px;}
</style>
</head>
<body>
<div id="content">

  <include file="Public/maintop" />

  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">

        <div class="widget-box">
          <div class="widget-content tab-content">
            <div id="tab1" class="tab-pane active">
				<div class="widget-content nopadding">
				  <form action="{#$this_url_action}" method="post" class="form-horizontal" id="form_basic_validate">
<!--					<div class="control-group">-->
<!--					  <label class="control-label">广告名称 :</label>-->
<!--					  <div class="controls">-->
<!--						<input type="text" class="span3" name="title" value="{#$info.title}"   datatype="*2-50" nullmsg="请输入广告名称" errormsg="请输入广告名称(2-50位)"  sucmsg="验证通过！"/>-->
<!--						<div class="Validform_checktip">请输入广告名称</div>-->
<!--					  </div>-->
<!--					</div>-->
					  <div class="control-group">
						  <label class="control-label">广告位置 :</label>
						  <div class="controls">
							  <select name="cate_id">
								  <volist name="cate_list" id="item">
									  <option value="{#$key}" <if condition="$key eq $info[cate_id]">selected</if>>{#$item}</option>
								  </volist>
							  </select>
						  </div>
					  </div>
					  <div class="control-group">
						  <label class="control-label">广告图 :</label>
						  <div class="controls">
							  <div class="upload_img_list" id="cover_one_data">
								  <notempty name="info.cover">
									  <li><img src="{#$info.cover}" /></li>
								  </notempty>
							  </div>
							  <input type="hidden" class="span5" name="cover" id="cover" value="{#$info.cover}" />
							  <div style="width:100%;display: inline-block;"><a href="javascript:void(0);" onclick="upOneImage('cover')" class="btn btn-success" style="padding:5px 12px;">上传图片</a></div>
						  </div>
					  </div>
<!--					  <div class="control-group">-->
<!--						  <label class="control-label">跳转类型：</label>-->
<!--						  <div class="controls" style="padding:15px 0 0 0;">-->
<!--							  <label><input type="radio" name="jump_type" onclick="changeType()" value="0" <eq name="info.jump_type" value="0">checked</eq>/>普通</label>&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--							  <label><input type="radio" name="jump_type" onclick="changeType()" value="1" <eq name="info.jump_type" value="1">checked</eq>/>小程序</label>&nbsp;&nbsp;&nbsp;&nbsp;-->
<!--							  <label><input type="radio" name="jump_type" onclick="changeType()" value="2" <eq name="info.jump_type" value="2">checked</eq>/>网页</label>-->
<!--						  </div>-->
<!--					  </div>-->
<!--					  <div class="control-group is_show_appid_div" style="display: none;">-->
<!--						  <label class="control-label">APPID :</label>-->
<!--						  <div class="controls">-->
<!--							  <input type="text" class="span3" name="appid" value="{#$info.appid}" />-->
<!--							  <div class="Validform_checktip">当跳转为小程序时请填写APPID</div>-->
<!--						  </div>-->
<!--					  </div>-->
					  <div class="control-group">
						  <label class="control-label">跳转地址 :</label>
						  <div class="controls">
							  <input type="text" class="span5" id="url_select_val" name="url" value="{#$info.url}">
<!--							  <a href="javascript:void(0);" id="btn_url_select" class="btn btn-success" style="padding:5px 12px;">选择</a>-->
						  </div>
					  </div>
					  <div class="control-group">
						  <label class="control-label">排序 :</label>
						  <div class="controls">
							  <input type="text" class="span1" name="is_order" value="{#$info.is_order}">
							  <div class="Validform_checktip">数字越小越靠前</div>
						  </div>
					  </div>
					<div class="form-actions">
					  <input type="hidden" name="id" value="{#$info.id|default=''}">
					  <button type="submit" class="btn btn-success">保存</button>
					</div>
				  </form>
				</div>

            </div>
          </div>
        </div>

      </div>
    </div>
    <hr>
    </div>
  </div>
</div>
<textarea id="upload_editor" style="width: 0;height: 0;display: none;"></textarea>
<script src="__PUBLIC__/Admin/js/jquery.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.ui.custom.js"></script>
<script src="__PUBLIC__/Admin/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.uniform.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/Validform.min.js"></script>
<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/ueditor.all.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    var ue_uploader = UE.getEditor('upload_editor',{serverUrl:"{#:U('NewUpload/upload')}"});
    function upOneImage(fname){
        ue_uploader.ready(function(){
            var pickey = 1;
            ue_uploader.addListener('beforeInsertImage', function (t,arg){
                if(pickey == 1){
                    $("#" + fname +"_one_data").html('<li><img src="' + arg[0].src + '" /></li>');
                    $("#" + fname).val(arg[0].src);
                }
                pickey ++;
            });
        });
        var myImage = ue_uploader.getDialog("insertimage");
        myImage.open();
    }
    $("#btn_url_select").click(function () {
        layer.open({
            type: 2,
            title: '选择地址',
            shadeClose: true,
            shade: 0.3,
            maxmin: false,
            area: ['893px', '600px'],
            content: "{#:U('Link/getLinkData')}"
        });
    });
    $(function () {
        changeType("{#$info.jump_type}");
    })
    function changeType() {
        var this_val = $("input[name='jump_type']:checked").val();
        if(this_val == 1){
            $(".is_show_appid_div").show();
        }else{
            $(".is_show_appid_div").hide();
        }
    }
</script>
<script type="text/javascript">
    $(function(){
        $('input[type=checkbox],input[type=radio],input[type=file]').uniform();
        var loadi = null;
        var demo1 = $("#form_basic_validate").Validform({
            tiptype:3,
            ajaxPost:true,
            postonce:true,
            tiptype: function (msg, o, cssctl) {
                if (!o.obj.is("form")) {
                    var objtip=o.obj.siblings(".Validform_checktip");
                    cssctl(objtip,o.type);
                    objtip.text(msg);
                }
            },
            beforeSubmit:function(curform){
                loadi = layer.load('表单正在处理中，请稍等 ...');
            },
            callback:function(data){
                layer.close(loadi);
                if(data.status == 1){
                    layer.alert(data.msg,{icon:1},function(){
                        window.location.href="{#:U('index')}";
                    });
                }else{
                    layer.alert(data.msg,{icon:0});
                }
            }
        });
    })
</script>
</body>
</html>
